<include file="Public/header.html"/>
</head>
<body>
	<style>
		.layui-form-pane .layui-input-inline{width: 130px;}
		.layui-btn-xs{margin-left: 0 !important;}
	</style>
    <div class="x-nav">
        <span class="layui-breadcrumb">
          <a><cite>首页</cite></a>
          <a><cite>用户管理</cite></a>
          <a><cite>团队列表</cite></a>
        </span>
       <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right;height:30px;padding: 0 15px;"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
        <form class="layui-form x-center" action="{:U('Home/Web/User/user_list')}" method="post" style="width:95%;margin-left: 5%;">
            <div class="layui-form-pane" style="margin-top: 15px;">
              	<div class="layui-form-item">             	                            
	                <div class="layui-input-inline">
	                  	<input type="text" name="nickname" value="{$nickname}"  placeholder="请输入微信昵称" autocomplete="off" class="layui-input">
	                </div>
	                <div class="layui-input-inline" style="width:80px">
	                    <button class="layui-btn" type="submit"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
	                </div>
              	</div>
            </div> 
        </form>
      	<form id="delform" class="layui-form">    	 	
      	 	<table class="layui-table">     	 		
	            <thead>
	                <tr>
                    	<th>ID</th>
	                	<th>头像</th>
	                    <th>微信昵称</th>
	                    <th>性别</th>	  
	                    <th>OPENID</th>
	                    <th>佣金</th>
	                    <th>时间</th>
	                    <th>操作</th>
	                </tr>
	            </thead>
          
	            <tbody id="formdata">
	              	<volist name="list" id="v">	
	                <tr>
                    	<td>{$v.id}</td>
	                    <td><img src="{$v.avatar}" style="width: 50px;" alt="" /></td>
	                    <td>{$v.nickname}</td>
	                   	<td><?php 
	                    	if($v['sex']==1){
	                    		echo '男';
	                    	}else if($v['sex']==2){
	                    		echo '女';
	                    	}else{
	                    		echo '保密';
	                    	}
	                    ?>
	                    </td>
	                    <td>{$v.openid}</td>
	                    <td>{$v.cash}</td>
	                    <td><?php echo date('Y-m-d H:i:s', $v['add_time']); ?></td>
	                    <td>
	                    	<span class="layui-btn layui-btn-xs" onclick="user_cash('佣金明细','{:U('Home/Web/User/user_cash',array('uid'=>$v['id'],'flag'=>1))}','800','')">佣金明细</span>
							<span class="layui-btn layui-btn-xs layui-btn-warm" onclick="my_user('我的下级','{:U('Home/Web/User/my_user',array('id'=>$v['id']))}','800','')">我的下级</span>
	                    </td>
	                </tr>
	              	</volist>  
	            </tbody>
            </table>
        </form>
        <span class="x-right" style="line-height:40px">共有数据：{$count} 条</span>
        <div id="page"></div>
    </div>
	<include file="Public/footer.html"/>
	<script src="__ROOT__/Public/js/jquery.wallform.js"></script>
	<script>    	
		layui.use(['form','element','laypage','layer'], function(){
			var laypage = layui.laypage;//分页
			var layer = layui.layer;//弹出层
			var form = layui.form;
			$ = layui.jquery; 
		  
			laypage.render({
				elem: 'page',
				count: '{$count}',
				limit: '{$limit}',
				curr : '{$page}', 
				jump: function(obj, first){
					if(!first){ 
						var $purl = "{:U('Home/Web/User/user_list',array('page'=>'pageval','nickname'=>$nickname))}"
						window.location.href= $purl.replace('pageval',obj.curr);  			
					}
				}
			});
			
		});
		function user_cash(title,url,w,h){
			if (title == null || title == '') {
				title=false;
			};
			if (url == null || url == '') {
				url="404.html";
			};
			if (w == null || w == '') {
				w=800;
			};
			if (h == null || h == '') {
				h=($(window).height() - 50);
			};
			
			var index = layer.open({
				id:'ch',
				type: 2,
				area: [w+'px',h +'px'],
				fix: false, //不固定
				maxmin: true,
				shadeClose: true,
				shade:0.4,
				title: title,
				content: url,
			});
		}
		function my_user(title,url,w,h){
			if (title == null || title == '') {
				title=false;
			};
			if (url == null || url == '') {
				url="404.html";
			};
			if (w == null || w == '') {
				w=800;
			};
			if (h == null || h == '') {
				h=($(window).height() - 50);
			};
			
			var index = layer.open({
				id:'ch',
				type: 2,
				area: [w+'px',h +'px'],
				fix: false, //不固定
				maxmin: true,
				shadeClose: true,
				shade:0.4,
				title: title,
				content: url,
			});
		}
	</script>  
	</div>	
</body>
</html>